package org.mtmi.ui.drawables;

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Point;

/** Default implementation for IColorDrawable, by default size is 24x24 */
public abstract class AbstractColorDrawable implements IColorDrawable 
{
	protected Color color;
	
	/** caller is responsible to dispose color */
	public AbstractColorDrawable( Color clr ) {
		color = clr;
	}
	
	public Color getColor() { return color; }
	
	/** caller is responsible to dispose color */
	public void setColor( Color c ) { color=c; }
	
	@Override
	public Point computeSize( int width, int height ) {
		int r = Math.min( width, height );
		if( r < 24 ) r=24;
		return new Point( r, r );
	}
}
